/**
 * @author Fang Lu, fanglupku@gmail.com
 * 2011-6-3
 */
package com.autotag.train;

import java.util.ArrayList;

public class WebServiceAbstract {
	private String uuid;
	private ArrayList<String> textSegmentList;
	private String sig;
	public WebServiceAbstract(String uuid, ArrayList<String> textSegmentList){
		this.uuid = uuid;
		this.textSegmentList = textSegmentList;
		this.sig = computeSig(textSegmentList);
	}
	public String getUuid() {
		return uuid;
	}
	public void setUuid(String uuid) {
		this.uuid = uuid;
	}
	public ArrayList<String> getTextSegmentList() {
		return textSegmentList;
	}
	public void setTextSegmentList(ArrayList<String> textSegmentList) {
		this.textSegmentList = textSegmentList;
	}
	public String getSig() {
		return sig;
	}
	public static String computeSig(ArrayList<String> textSegmentList){
		int code = 0;
		int base = 1;
		for (int i=0; i<textSegmentList.size(); ++i) {
			code += base * textSegmentList.get(i).hashCode();
			base *= 10;
		}
		return "" + code;
	}
	public void setSig(String sig) {
		this.sig = sig;
	}
	
}
